﻿@model FieldInfo
@using JX.Application
@inject IModelsServiceAppDapper m_ModelsService
@inject IUserGroupsServiceAppDapper m_UserGroupsServiceApp
@inject IRolesServiceAppDapper m_RolesServiceApp
@{
	var SelectGroupID = string.Empty;
	var SelectRoleID = string.Empty;

	string[] separator = new string[] { "$$$" };
	var TextTypeMaxLength = "200";
	var TextTypeRegexRule = string.Empty;
	var TextTypeRegexErrorMsg = string.Empty;
	var MultipleHtmlTextTypeEditorType = "9";
	var EnableInsideLink = "false";
	var EnableFilterWord = "false";
	var EnableShieldWord = "false";

	var IntegerTypeMinLength = "0";
	var IntegerTypeMaxLength = "100";
	var IntegerTypePercent = "false";

	var NumberTypeMinLength = "0";
	var NumberTypeMaxLength = "100";
	var NumberTypeDecimals = "-1";
	var NumberTypePercent = "false";

	var MoneyTypeMinLength = "1";
	var MoneyTypeMaxLength = "999999";

	var FileTypeFileSize = ConfigHelper.Get<UploadFilesConfig>().UploadFileMaxSize.ToString();
	var FileTypeFileExts = ConfigHelper.Get<UploadFilesConfig>().UploadFileExts;
	var FileTypeIsDownLoad = "false";
	var FileTypeIsSaveFileSize = "true";
	var FileTypeSizeFieldName = "FileSize";
	var FileTypeFileNameRule = "{$Random}";
	var FileTypeFileUrlPrdfix = "下载地址";
	var FileTypeFileMaxCount = "1";

	var PictureTypeImageSize = ConfigHelper.Get<UploadFilesConfig>().UploadFileMaxSize.ToString();
	var PictureTypeImageExts = "gif,jpg,jpeg,jpe,bmp,png";
	var PictureTypeIsThumb = "false";
	var PictureTypeIsWaterMark = "false";

	var MultiplePhotoTypeImageSize = ConfigHelper.Get<UploadFilesConfig>().UploadFileMaxSize.ToString();
	var MultiplePhotoTypeImageExts = "gif,jpg,jpeg,jpe,bmp,png";
	var MultiplePhotoTypeIsWaterMark = "false";

	var ListBoxTypeDataList = new List<SelectListItem>();
	var ListBoxTypeShowType = "1";
	var ListBoxTypeRepeatColumns = "1";

	var ListBoxIntroTypeDataList = new List<SelectListItem>();
	var ListBoxIntroTypeShowType = "1";
	var ListBoxIntroTypeRepeatColumns = "1";

	var ListBoxDataTypeSQL = string.Empty;
	var ListBoxDataTypeTextField = string.Empty;
	var ListBoxDataTypeValueField = string.Empty;
	var ListBoxDataTypeValueFieldType = string.Empty;
	var ListBoxDataTypeShowType = "1";
	var ListBoxDataTypeIsFillData = "false";
	var ListBoxDataTypeRepeatColumns = "1";

	var BoolTypeTrueText = "是";
	var BoolTypeFalseText = "否";

	var DateTimeTypeFormat = "date";
	var DateTimeTypeDefaultType = "1";
	var DateTimeTypeIsRange = "false";

	var resultModelList = m_ModelsService.GetContentModelList(ModelShowType.Enable).ToList();
	var selectListLookType = new SelectList(resultModelList, "ModelID", "ModelName");
	var selectItemListLookType = new List<SelectListItem>();
	selectItemListLookType.AddRange(selectListLookType);
	FieldType[] fieldType = new FieldType[] { FieldType.TextType, FieldType.TitleType };
	var resultFieldNameList = m_ModelsService.GetFieldNames(resultModelList[0].ModelID.ToInt32(), fieldType);
	List<object> dataFieldNameList = new List<object>();
	foreach (System.Data.DataRow row in resultFieldNameList.Rows)
	{
		dataFieldNameList.Add(new
		{
			FieldName = row["FieldName"].ToString(),
			FieldAlias = row["FieldAlias"].ToString()
		});
	}
	var selectListLookTypeFieldName = new SelectList(dataFieldNameList, "FieldName", "FieldAlias");
	var selectItemListLookTypeFieldName = new List<SelectListItem>();
	selectItemListLookTypeFieldName.AddRange(selectListLookTypeFieldName);
	var LookTypeModelID = resultModelList[0].ModelID.ToString();
	var LookTypeFieldName = "Title";

	var OperatingTypeSelectItem = string.Empty;
	var OperatingTypeIsSave = "false";

	var RegionTypeShowType = "5";
	var RegionTypeSelectCountry = "中华人民共和国";
	var RegionTypeSelectProvince = string.Empty;
	var RegionTypeSelectCity = string.Empty;
	var RegionTypeSelectArea = string.Empty;

	var RegionTypeTextShowType = "5";
	var RegionTypeTextSelectCountry = "中华人民共和国";
	var RegionTypeTextSelectProvince = string.Empty;
	var RegionTypeTextSelectCity = string.Empty;
	var RegionTypeTextSelectArea = string.Empty;
	var RegionTypeTextSelectAddress = string.Empty;

	var RegionTypeFiveShowType = "5";
	var RegionTypeFiveSelectCountry = "中华人民共和国";
	var RegionTypeFiveSelectProvince = string.Empty;
	var RegionTypeFiveSelectCity = string.Empty;
	var RegionTypeFiveSelectArea = string.Empty;
	var RegionTypeFiveSelectArea1 = string.Empty;
	var RegionTypeFiveSelectArea2 = string.Empty;

	var RegionTypeSelectSelectProvince = string.Empty;
	var RegionTypeSelectSelectCity = string.Empty;
	var RegionTypeSelectSelectArea = string.Empty;

	var IndustryCategoryRootID = string.Empty;

	var PropertySelectValue = string.Empty;
	var ProductStyleSelectValue = string.Empty;

	var TitleTypeMaxLength = string.Empty;
	var TitleTypeCheckIsExist = "false";
	var TitleTypeCreatePY = "false";

	if (ViewBag.mAction == "Modify" || ViewBag.mAction == "Copy")
	{
		//字段的会员组权限表
		IList<GroupFieldPermissionsEntity> fieldPermissionById = await m_UserGroupsServiceApp.GetFieldPermissionsById(0, ViewBag.ModelID, 1, Model.FieldName);
		foreach (var item in fieldPermissionById)
		{
			SelectGroupID += item.GroupID.ToString() + ",";
		}
		SelectGroupID = SelectGroupID.TrimEnd(',');
		//字段的角色权限表
		IList<RoleFieldPermissionsEntity> fieldPermissionByModelId = await m_RolesServiceApp.GetFieldPermissionsById(-1, ViewBag.ModelID, Model.FieldName);
		foreach (var item in fieldPermissionByModelId)
		{
			SelectRoleID += item.RoleID.ToString() + ",";
		}
		SelectRoleID = SelectRoleID.TrimEnd(',');
		var settingLength = Model.Settings.Count;
		switch (Model.FieldType)
		{
			case FieldType.TextType:
				TextTypeMaxLength = Model.Settings[0];
				EnableInsideLink = Model.Settings[4];
				EnableFilterWord = Model.Settings[5];
				EnableShieldWord = Model.Settings[6];
				if (settingLength > 8)
				{
					TextTypeRegexRule = Model.Settings[7];
					TextTypeRegexErrorMsg = Model.Settings[8];
				}
				break;
			case FieldType.MultipleTextType:
				EnableInsideLink = Model.Settings[2];
				EnableFilterWord = Model.Settings[3];
				EnableShieldWord = Model.Settings[4];
				break;
			case FieldType.MultipleHtmlTextType:
				MultipleHtmlTextTypeEditorType = Model.Settings[0];
				EnableInsideLink = Model.Settings[3];
				EnableFilterWord = Model.Settings[4];
				EnableShieldWord = Model.Settings[5];
				break;
			case FieldType.IntegerType:
				IntegerTypeMinLength = Model.Settings[0];
				IntegerTypeMaxLength = Model.Settings[1];
				IntegerTypePercent = Model.Settings[2];
				break;
			case FieldType.NumberType:
				NumberTypeMinLength = Model.Settings[0];
				NumberTypeMaxLength = Model.Settings[1];
				NumberTypeDecimals = Model.Settings[2];
				NumberTypePercent = Model.Settings[3].ToBoolean().ToString().ToLower();
				break;
			case FieldType.MoneyType:
				MoneyTypeMinLength = Model.Settings[0];
				MoneyTypeMaxLength = Model.Settings[1];
				break;
			case FieldType.FileType:
				FileTypeFileSize = Model.Settings[0];
				FileTypeFileExts = Model.Settings[1];
				FileTypeIsDownLoad = Model.Settings[2];
				FileTypeIsSaveFileSize = Model.Settings[3];
				FileTypeSizeFieldName = Model.Settings[3].ToBoolean() ? Model.Settings[4] : string.Empty;
				if (settingLength > 5)
				{
					FileTypeFileNameRule = Model.Settings[5];
				}
				if (settingLength > 6)
				{
					FileTypeFileUrlPrdfix = Model.Settings[6];
				}
				if (settingLength > 7)
				{
					FileTypeFileMaxCount = Model.Settings[7];
				}
				break;
			case FieldType.PictureType:
				PictureTypeImageSize = Model.Settings[1];
				PictureTypeImageExts = Model.Settings[2];
				PictureTypeIsWaterMark = Model.Settings[4];
				PictureTypeIsThumb = Model.Settings[5];
				break;
			case FieldType.MultiplePhotoType:
				MultiplePhotoTypeImageSize = Model.Settings[0];
				MultiplePhotoTypeImageExts = Model.Settings[1];
				MultiplePhotoTypeIsWaterMark = Model.Settings[2];
				break;
			case FieldType.ListBoxType:
			case FieldType.ListBoxIntroType:
				string[] selectItemList = Model.Settings[0].Split(separator, StringSplitOptions.RemoveEmptyEntries);
				var selectList = new SelectList(selectItemList);
				if (Model.FieldType == FieldType.ListBoxType)
				{
					ListBoxTypeDataList.AddRange(selectList);
					ListBoxTypeShowType = Model.Settings[1];
					if (settingLength > 3)
					{
						ListBoxTypeRepeatColumns = Model.Settings[3];
					}
				}
				else if (Model.FieldType == FieldType.ListBoxIntroType)
				{
					ListBoxIntroTypeDataList.AddRange(selectList);
					ListBoxIntroTypeShowType = Model.Settings[1];
					ListBoxIntroTypeRepeatColumns = Model.Settings[2];
				}
				break;
			case FieldType.ListBoxDataType:
				ListBoxDataTypeSQL = Model.Settings[0];
				ListBoxDataTypeTextField = Model.Settings[1];
				ListBoxDataTypeValueField = Model.Settings[2];
				ListBoxDataTypeValueFieldType = Model.Settings[3];
				ListBoxDataTypeShowType = Model.Settings[4];
				ListBoxDataTypeIsFillData = Model.Settings[5];
				ListBoxDataTypeRepeatColumns = Model.Settings[6];
				break;
			case FieldType.BoolType:
				if (settingLength >= 2)
				{
					BoolTypeTrueText = Model.Settings[0];
					BoolTypeFalseText = Model.Settings[1];
				}
				break;
			case FieldType.DateTimeType:
				DateTimeTypeFormat = Model.Settings[0];
				DateTimeTypeDefaultType = Model.Settings[1];
				if (settingLength > 2)
				{
					DateTimeTypeIsRange = Model.Settings[2].ToBoolean().ToString().ToLower();
				}
				break;
			case FieldType.LookType:
				LookTypeModelID = Model.Settings[0];
				LookTypeFieldName = Model.Settings[1];
				break;
			case FieldType.OperatingType:
				OperatingTypeSelectItem = Model.Settings[0].Replace("$$$", "\r\n");
				OperatingTypeIsSave = Model.Settings[2];
				break;
			case FieldType.RegionType:
				RegionTypeShowType = Model.Settings[1];
				string RegionTypeDefaultValue = Model.Settings[2];
				var arrValueRegionType = RegionTypeDefaultValue.Split(new char[] { ',' });
				RegionTypeSelectCountry = (!string.IsNullOrEmpty(arrValueRegionType[0])) ? arrValueRegionType[0] : "中华人民共和国";
				RegionTypeSelectProvince = arrValueRegionType[1];
				RegionTypeSelectCity = arrValueRegionType[2];
				RegionTypeSelectArea = arrValueRegionType[3];
				break;
			case FieldType.RegionTypeText:
				RegionTypeTextShowType = Model.Settings[1];
				string RegionTypeTextDefaultValue = Model.Settings[2];
				var arrValueRegionTypeText = RegionTypeTextDefaultValue.Split(new char[] { ',' });
				RegionTypeTextSelectCountry = (!string.IsNullOrEmpty(arrValueRegionTypeText[0])) ? arrValueRegionTypeText[0] : "中华人民共和国";
				RegionTypeTextSelectProvince = arrValueRegionTypeText[1];
				RegionTypeTextSelectCity = arrValueRegionTypeText[2];
				RegionTypeTextSelectArea = arrValueRegionTypeText[3];
				RegionTypeTextSelectAddress = arrValueRegionTypeText[4];
				break;
			case FieldType.RegionTypeFive:
				RegionTypeFiveShowType = Model.Settings[1];
				string RegionTypeFiveDefaultValue = Model.Settings[2];
				var arrValueRegionTypeFive = RegionTypeFiveDefaultValue.Split(new char[] { ',' });
				RegionTypeFiveSelectCountry = (!string.IsNullOrEmpty(arrValueRegionTypeFive[0])) ? arrValueRegionTypeFive[0] : "中华人民共和国";
				RegionTypeFiveSelectProvince = arrValueRegionTypeFive[1];
				RegionTypeFiveSelectCity = arrValueRegionTypeFive[2];
				RegionTypeFiveSelectArea = arrValueRegionTypeFive[3];
				RegionTypeFiveSelectArea1 = arrValueRegionTypeFive[4];
				RegionTypeFiveSelectArea2 = arrValueRegionTypeFive[5];
				break;
			case FieldType.RegionTypeSelect:
				var arrValueRegionTypeSelect = Model.Settings[0].Split(new char[] { ',' });
				RegionTypeSelectSelectProvince = arrValueRegionTypeSelect[0];
				RegionTypeSelectSelectCity = arrValueRegionTypeSelect[1];
				RegionTypeSelectSelectArea = arrValueRegionTypeSelect[2];
				break;
			case FieldType.IndustryCategory:
				if (settingLength > 1)
				{
					IndustryCategoryRootID = Model.Settings[0];
				}
				break;
			case FieldType.Property:
				PropertySelectValue = Model.Settings[0];
				break;
			case FieldType.ProductStyle:
				ProductStyleSelectValue = Model.Settings[0];
				break;
			case FieldType.TitleType:
				TitleTypeMaxLength = Model.Settings[0];
				TitleTypeCheckIsExist = Model.Settings[2];
				if (settingLength > 3)
				{
					TitleTypeCreatePY = Model.Settings[3];
				}
				break;
		}
	}
}
<div class="layui-row layui-col-space15">
	<div class="layui-col-md12">

		<div class="layui-card">
			<div class="layui-card-header layui-elem-quote">字段信息</div>
			<div class="layui-card-body" pad15>
				<form class="layui-form" asp-controller="CommonModel" asp-action="FieldEdit" wid100 method="post" lay-filter="myForm">
					<div class="layui-form-item">
						<label class="layui-form-label"><span class="c-red">*</span>字段名称</label>
						<div class="layui-input-block">
							@{
								if (ViewBag.mAction == "Modify")
								{
									<input type="text" readonly="readonly" class="layui-input layui-disabled" asp-for="@Model.FieldName" />
								}
								else
								{
									<input type="text" class="layui-input" asp-for="@Model.FieldName" />
									<span asp-validation-for="@Model.FieldName" style="color:red;"></span>
								}
							}
						</div>
					</div>
					<div class="layui-form-item">
						<label class="layui-form-label"><span class="c-red">*</span>字段别名</label>
						<div class="layui-input-block">
							<input type="text" class="layui-input" asp-for="FieldAlias" />
							<span asp-validation-for="FieldAlias" style="color:red;"></span>
						</div>
					</div>
					<div class="layui-form-item">
						<label class="layui-form-label">字段描述</label>
						<div class="layui-input-block">
							<textarea class="layui-textarea" asp-for="Description"></textarea>
						</div>
					</div>
					<div class="layui-form-item">
						<label class="layui-form-label">是否禁用</label>
						<div class="layui-input-block">
							<input type="checkbox" asp-for="Disabled" lay-skin="switch" lay-text="已禁用|已启用">
						</div>
					</div>
					<div class="layui-form-item">
						<label class="layui-form-label">是否必填</label>
						<div class="layui-input-block">
							<input type="checkbox" asp-for="EnableNull" lay-skin="switch" lay-text="必填|可空">
						</div>
					</div>
					<div class="layui-form-item">
						<label class="layui-form-label">允许搜索</label>
						<div class="layui-input-block">
							<input type="checkbox" asp-for="EnableShowOnSearchForm" lay-skin="switch" lay-text="是|否">
						</div>
					</div>
					<div class="layui-form-item">
						<label class="layui-form-label">字段类型</label>
						<div class="layui-input-block">
							<div class="layui-col-xs4 layui-col-sm4 layui-col-md4">
								<input type="radio" name="RadFieldType" value="@FieldType.TextType" title="@EnumHelper.GetDescription(FieldType.TextType)" checked="" lay-filter="SelectFieldType" />
							</div>
							<div class="layui-col-xs4 layui-col-sm4 layui-col-md4">
								<input type="radio" name="RadFieldType" value="@FieldType.MultipleTextType" title="@EnumHelper.GetDescription(FieldType.MultipleTextType)" lay-filter="SelectFieldType" />
							</div>
							<div class="layui-col-xs4 layui-col-sm4 layui-col-md4">
								<input type="radio" name="RadFieldType" value="@FieldType.MultipleHtmlTextType" title="@EnumHelper.GetDescription(FieldType.MultipleHtmlTextType)" lay-filter="SelectFieldType" />
							</div>
							<div class="layui-col-xs4 layui-col-sm4 layui-col-md4">
								<input type="radio" name="RadFieldType" value="@FieldType.IntegerType" title="@EnumHelper.GetDescription(FieldType.IntegerType)" lay-filter="SelectFieldType" />
							</div>
							<div class="layui-col-xs4 layui-col-sm4 layui-col-md4">
								<input type="radio" name="RadFieldType" value="@FieldType.NumberType" title="@EnumHelper.GetDescription(FieldType.NumberType)" lay-filter="SelectFieldType" />
							</div>
							<div class="layui-col-xs4 layui-col-sm4 layui-col-md4">
								<input type="radio" name="RadFieldType" value="@FieldType.MoneyType" title="@EnumHelper.GetDescription(FieldType.MoneyType)" lay-filter="SelectFieldType" />
							</div>
							<div class="layui-col-xs4 layui-col-sm4 layui-col-md4">
								<input type="radio" name="RadFieldType" value="@FieldType.FileType" title="@EnumHelper.GetDescription(FieldType.FileType)" lay-filter="SelectFieldType" />
							</div>
							<div class="layui-col-xs4 layui-col-sm4 layui-col-md4">
								<input type="radio" name="RadFieldType" value="@FieldType.PictureType" title="@EnumHelper.GetDescription(FieldType.PictureType)" lay-filter="SelectFieldType" />
							</div>
							<div class="layui-col-xs4 layui-col-sm4 layui-col-md4">
								<input type="radio" name="RadFieldType" value="@FieldType.MultiplePhotoType" title="@EnumHelper.GetDescription(FieldType.MultiplePhotoType)" lay-filter="SelectFieldType" />
							</div>
							<div class="layui-col-xs4 layui-col-sm4 layui-col-md4">
								<input type="radio" name="RadFieldType" value="@FieldType.ListBoxType" title="@EnumHelper.GetDescription(FieldType.ListBoxType)" lay-filter="SelectFieldType" />
							</div>
							@*<div class="layui-col-xs4 layui-col-sm4 layui-col-md4">
			<input type="radio" name="RadFieldType" value="@FieldType.ListBoxIntroType" title="@EnumHelper.GetDescription(FieldType.ListBoxIntroType)" lay-filter="SelectFieldType" />
		</div>*@
							<div class="layui-col-xs4 layui-col-sm4 layui-col-md4">
								<input type="radio" name="RadFieldType" value="@FieldType.ListBoxDataType" title="@EnumHelper.GetDescription(FieldType.ListBoxDataType)" lay-filter="SelectFieldType" />
							</div>
							<div class="layui-col-xs4 layui-col-sm4 layui-col-md4">
								<input type="radio" name="RadFieldType" value="@FieldType.BoolType" title="@EnumHelper.GetDescription(FieldType.BoolType)" lay-filter="SelectFieldType" />
							</div>
							<div class="layui-col-xs4 layui-col-sm4 layui-col-md4">
								<input type="radio" name="RadFieldType" value="@FieldType.DateTimeType" title="@EnumHelper.GetDescription(FieldType.DateTimeType)" lay-filter="SelectFieldType" />
							</div>
							<div class="layui-col-xs4 layui-col-sm4 layui-col-md4">
								<input type="radio" name="RadFieldType" value="@FieldType.LinkType" title="@EnumHelper.GetDescription(FieldType.LinkType)" lay-filter="SelectFieldType" />
							</div>
							<div class="layui-col-xs4 layui-col-sm4 layui-col-md4">
								<input type="radio" name="RadFieldType" value="@FieldType.ColorType" title="@EnumHelper.GetDescription(FieldType.ColorType)" lay-filter="SelectFieldType" />
							</div>
							<div class="layui-col-xs4 layui-col-sm4 layui-col-md4">
								<input type="radio" name="RadFieldType" value="@FieldType.LookType" title="@EnumHelper.GetDescription(FieldType.LookType)" lay-filter="SelectFieldType" />
							</div>
							<div class="layui-col-xs4 layui-col-sm4 layui-col-md4">
								<input type="radio" name="RadFieldType" value="@FieldType.OperatingType" title="@EnumHelper.GetDescription(FieldType.OperatingType)" lay-filter="SelectFieldType" />
							</div>
							<div class="layui-col-xs4 layui-col-sm4 layui-col-md4">
								<input type="radio" name="RadFieldType" value="@FieldType.NumBuilder" title="@EnumHelper.GetDescription(FieldType.NumBuilder)" lay-filter="SelectFieldType" />
							</div>
							<div class="layui-col-xs4 layui-col-sm4 layui-col-md4">
								<input type="radio" name="RadFieldType" value="@FieldType.ValidateCodeType" title="@EnumHelper.GetDescription(FieldType.ValidateCodeType)" lay-filter="SelectFieldType" />
							</div>
							<div class="layui-col-xs4 layui-col-sm4 layui-col-md4">
								<input type="radio" name="RadFieldType" value="@FieldType.QRCodeType" title="@EnumHelper.GetDescription(FieldType.QRCodeType)" lay-filter="SelectFieldType" />
							</div>
							<div class="layui-col-xs4 layui-col-sm4 layui-col-md4">
								<input type="radio" name="RadFieldType" value="@FieldType.RegionType" title="@EnumHelper.GetDescription(FieldType.RegionType)" lay-filter="SelectFieldType" />
							</div>
							<div class="layui-col-xs4 layui-col-sm4 layui-col-md4">
								<input type="radio" name="RadFieldType" value="@FieldType.RegionTypeText" title="@EnumHelper.GetDescription(FieldType.RegionTypeText)" lay-filter="SelectFieldType" />
							</div>
							<div class="layui-col-xs4 layui-col-sm4 layui-col-md4">
								<input type="radio" name="RadFieldType" value="@FieldType.RegionTypeFive" title="@EnumHelper.GetDescription(FieldType.RegionTypeFive)" lay-filter="SelectFieldType" />
							</div>
							<div class="layui-col-xs4 layui-col-sm4 layui-col-md4">
								<input type="radio" name="RadFieldType" value="@FieldType.RegionTypeSelect" title="@EnumHelper.GetDescription(FieldType.RegionTypeSelect)" lay-filter="SelectFieldType" />
							</div>
							<div class="layui-col-xs4 layui-col-sm4 layui-col-md4">
								<input type="radio" name="RadFieldType" value="@FieldType.ContentType" title="@EnumHelper.GetDescription(FieldType.ContentType)" lay-filter="SelectFieldType" />
							</div>
							<div class="layui-col-xs4 layui-col-sm4 layui-col-md4">
								<input type="radio" name="RadFieldType" value="@FieldType.SelectUserType" title="@EnumHelper.GetDescription(FieldType.SelectUserType)" lay-filter="SelectFieldType" />
							</div>
							<div class="layui-col-xs4 layui-col-sm4 layui-col-md4">
								<input type="radio" name="RadFieldType" value="@FieldType.IPType" title="@EnumHelper.GetDescription(FieldType.IPType)" lay-filter="SelectFieldType" />
							</div>
							<div class="layui-col-xs4 layui-col-sm4 layui-col-md4">
								<input type="radio" name="RadFieldType" value="@FieldType.UserNameType" title="@EnumHelper.GetDescription(FieldType.UserNameType)" lay-filter="SelectFieldType" />
							</div>
							<div class="layui-col-xs4 layui-col-sm4 layui-col-md4">
								<input type="radio" name="RadFieldType" value="@FieldType.NodeCategory" title="@EnumHelper.GetDescription(FieldType.NodeCategory)" lay-filter="SelectFieldType" />
							</div>
							<div class="layui-col-xs4 layui-col-sm4 layui-col-md4">
								<input type="radio" name="RadFieldType" value="@FieldType.IndustryCategory" title="@EnumHelper.GetDescription(FieldType.IndustryCategory)" lay-filter="SelectFieldType" />
							</div>
							@{
								if (ViewBag.ModelType == 2)
								{
									<div class="layui-col-xs4 layui-col-sm4 layui-col-md4">
										<input type="radio" name="RadFieldType" value="@FieldType.Producer" title="@EnumHelper.GetDescription(FieldType.Producer)" lay-filter="SelectFieldType" />
									</div>
									<div class="layui-col-xs4 layui-col-sm4 layui-col-md4">
										<input type="radio" name="RadFieldType" value="@FieldType.Trademark" title="@EnumHelper.GetDescription(FieldType.Trademark)" lay-filter="SelectFieldType" />
									</div>
									<div class="layui-col-xs4 layui-col-sm4 layui-col-md4">
										<input type="radio" name="RadFieldType" value="@FieldType.Property" title="@EnumHelper.GetDescription(FieldType.Property)" lay-filter="SelectFieldType" />
									</div>
									<div class="layui-col-xs4 layui-col-sm4 layui-col-md4">
										<input type="radio" name="RadFieldType" value="@FieldType.ProductStyle" title="@EnumHelper.GetDescription(FieldType.ProductStyle)" lay-filter="SelectFieldType" />
									</div>
								}
							}
							@{
								if (ViewBag.mAction == "Modify" || ViewBag.mAction == "Copy")
								{
									<div class="layui-col-xs4 layui-col-sm4 layui-col-md4">
										<input type="radio" name="RadFieldType" value="@FieldType.NodeType" title="@EnumHelper.GetDescription(FieldType.NodeType)" lay-filter="SelectFieldType" />
									</div>
									<div class="layui-col-xs4 layui-col-sm4 layui-col-md4">
										<input type="radio" name="RadFieldType" value="@FieldType.InfoType" title="@EnumHelper.GetDescription(FieldType.InfoType)" lay-filter="SelectFieldType" />
									</div>
									<div class="layui-col-xs4 layui-col-sm4 layui-col-md4">
										<input type="radio" name="RadFieldType" value="@FieldType.SpecialType" title="@EnumHelper.GetDescription(FieldType.SpecialType)" lay-filter="SelectFieldType" />
									</div>
									<div class="layui-col-xs4 layui-col-sm4 layui-col-md4">
										<input type="radio" name="RadFieldType" value="@FieldType.TitleType" title="@EnumHelper.GetDescription(FieldType.TitleType)" lay-filter="SelectFieldType" />
									</div>
									<div class="layui-col-xs4 layui-col-sm4 layui-col-md4">
										<input type="radio" name="RadFieldType" value="@FieldType.StatusType" title="@EnumHelper.GetDescription(FieldType.StatusType)" lay-filter="SelectFieldType" />
									</div>
									<div class="layui-col-xs4 layui-col-sm4 layui-col-md4">
										<input type="radio" name="RadFieldType" value="@FieldType.TemplateType" title="@EnumHelper.GetDescription(FieldType.TemplateType)" lay-filter="SelectFieldType" />
									</div>
								}
							}
						</div>
					</div>
					<div id="ctlFieldTypeTextType" style="display:none;">
						<div class="layui-form-item">
							<label class="layui-form-label">最大字符数</label>
							<div class="layui-input-block">
								<input type="text" class="layui-input" id="ctlTextTypeMaxLength" name="ctlTextTypeMaxLength" asp-for="@TextTypeMaxLength"
									   data-val="true" data-val-regex-pattern="@RegexHelper.NumberPattern" data-val-regex="只能是整数" />
								<span data-valmsg-for="ctlTextTypeMaxLength" data-valmsg-replace="true" style="color:red;"></span>
							</div>
						</div>
						<div class="layui-form-item">
							<label class="layui-form-label">验证规则</label>
							<div class="layui-input-block">
								<select id="ctlSelectRegexRule" name="ctlTextTypeBoxRegexRule" lay-filter="SelectRegexRule">
									<option value="">无</option>
									<option value="@RegexHelper.IpPattern">IP</option>
									<option value="@RegexHelper.EmailPattern">Email</option>
									<option value="@RegexHelper.MobilePattern">手机号码</option>
									<option value="@RegexHelper.IdCardPattern">身份证</option>
									<option value="@RegexHelper.ZipCodePattern">邮政编码</option>
									<option value="@RegexHelper.NumberPattern">纯数字</option>
									<option value="^[A-Za-z]+$">纯英文字母</option>
									<option value="^[\u4e00-\u9fa5]+$">纯中文</option>
								</select>
								<input type="text" class="layui-input" id="ctlTextTypeRegexRule" name="ctlTextTypeRegexRule" asp-for="@TextTypeRegexRule" placeholder="请输入正则表达式" />
							</div>
						</div>
						<div class="layui-form-item">
							<label class="layui-form-label">验证错误提示</label>
							<div class="layui-input-block">
								<input type="text" class="layui-input" id="ctlTextTypeRegexErrorMsg" name="ctlTextTypeRegexErrorMsg" asp-for="@TextTypeRegexErrorMsg" />
							</div>
						</div>
						<div class="layui-form-item">
							<label class="layui-form-label">默认值</label>
							<div class="layui-input-block">
								<input type="text" class="layui-input" id="ctlTextTypeDefaultValue" name="ctlTextTypeDefaultValue" asp-for="DefaultValue" />
							</div>
						</div>
					</div>
					<div id="ctlFieldTypeMultipleTextType" style="display:none;">
						<div class="layui-form-item">
							<label class="layui-form-label">默认值</label>
							<div class="layui-input-block">
								<textarea class="layui-textarea" id="ctlMultipleTextTypeDefaultValue" name="ctlMultipleTextTypeDefaultValue" asp-for="DefaultValue"></textarea>
							</div>
						</div>
					</div>
					<div id="ctlFieldTypeMultipleHtmlTextType" style="display:none;">
						<div class="layui-form-item">
							<label class="layui-form-label">编辑器类型</label>
							<div class="layui-input-block">
								<input type="radio" name="ctlEditorType" value="0" title="简洁型编辑器" asp-for="@MultipleHtmlTextTypeEditorType" />
								<input type="radio" name="ctlEditorType" value="9" title="标准型编辑器" asp-for="@MultipleHtmlTextTypeEditorType" />
							</div>
						</div>
						<div class="layui-form-item">
							<label class="layui-form-label">默认值</label>
							<div class="layui-input-block">
								@await Component.InvokeAsync("UEditor", new UEditorViewModel { ClientID = "ctlMultipleHtmlTextTypeDefaultValue", Content = Model.DefaultValue })
							</div>
						</div>
					</div>
					<div id="ctlAttachField" style="display:none;">
						<div class="layui-form-item">
							<label class="layui-form-label">启用站内链接</label>
							<div class="layui-input-block">
								<input type="checkbox" asp-for="@EnableInsideLink" id="InsideLink" name="InsideLink" lay-skin="switch" lay-text="是|否">
							</div>
						</div>
						<div class="layui-form-item">
							<label class="layui-form-label">启用字符过滤</label>
							<div class="layui-input-block">
								<input type="checkbox" asp-for="@EnableFilterWord" id="FilterWord" name="FilterWord" lay-skin="switch" lay-text="是|否">
							</div>
						</div>
						<div class="layui-form-item">
							<label class="layui-form-label">启用字符屏蔽</label>
							<div class="layui-input-block">
								<input type="checkbox" asp-for="@EnableShieldWord" id="ShieldWord" name="ShieldWord" lay-skin="switch" lay-text="是|否">
							</div>
						</div>
					</div>
					<div id="ctlFieldTypeIntegerType" style="display:none;">
						<div class="layui-form-item">
							<label class="layui-form-label">最小值</label>
							<div class="layui-input-block">
								<input type="text" class="layui-input" id="ctlIntegerTypeMinLength" name="ctlIntegerTypeMinLength" asp-for="@IntegerTypeMinLength"
									   data-val="true" data-val-regex-pattern="@RegexHelper.NumberPattern" data-val-regex="只能是整数" />
								<span data-valmsg-for="ctlIntegerTypeMinLength" data-valmsg-replace="true" style="color:red;"></span>
							</div>
						</div>
						<div class="layui-form-item">
							<label class="layui-form-label">最大值</label>
							<div class="layui-input-block">
								<input type="text" class="layui-input" id="ctlIntegerTypeMaxLength" name="ctlIntegerTypeMaxLength" asp-for="@IntegerTypeMaxLength"
									   data-val="true" data-val-regex-pattern="@RegexHelper.NumberPattern" data-val-regex="只能是整数"
									   data-val-compare-other="ctlIntegerTypeMinLength" data-val-compare-operator="GreaterThan" data-val-compare="最大值必须大于最小值" />
								<span data-valmsg-for="ctlIntegerTypeMaxLength" data-valmsg-replace="true" style="color:red;"></span>
							</div>
						</div>
						<div class="layui-form-item">
							<label class="layui-form-label">默认值</label>
							<div class="layui-input-block">
								<input type="text" class="layui-input" id="ctlIntegerTypeDefaultValue" name="ctlIntegerTypeDefaultValue" asp-for="DefaultValue" />
							</div>
						</div>
						<div class="layui-form-item">
							<label class="layui-form-label">以百分比显示</label>
							<div class="layui-input-block">
								<input type="checkbox" asp-for="@IntegerTypePercent" name="ctlIntegerTypePercent" lay-skin="switch" lay-text="是(例：50%)|否(例：50)" />
							</div>
						</div>
					</div>
					<div id="ctlFieldTypeNumberType" style="display:none;">
						<div class="layui-form-item">
							<label class="layui-form-label">最小值</label>
							<div class="layui-input-block">
								<input type="text" class="layui-input" id="ctlNumberTypeMinLength" name="ctlNumberTypeMinLength" asp-for="@NumberTypeMinLength"
									   data-val="true" data-val-regex-pattern="@RegexHelper.PositiveNumSignPattern" data-val-regex="只能是数字" />
								<span data-valmsg-for="ctlNumberTypeMinLength" data-valmsg-replace="true" style="color:red;"></span>
							</div>
						</div>
						<div class="layui-form-item">
							<label class="layui-form-label">最大值</label>
							<div class="layui-input-block">
								<input type="text" class="layui-input" id="ctlNumberTypeMaxLength" name="ctlNumberTypeMaxLength" asp-for="@NumberTypeMaxLength"
									   data-val="true" data-val-regex-pattern="@RegexHelper.PositiveNumSignPattern" data-val-regex="只能是数字"
									   data-val-compare-other="ctlNumberTypeMinLength" data-val-compare-operator="GreaterThan" data-val-compare="最大值必须大于最小值" />
								<span data-valmsg-for="ctlNumberTypeMaxLength" data-valmsg-replace="true" style="color:red;"></span>
							</div>
						</div>
						<div class="layui-form-item">
							<label class="layui-form-label">小数位数</label>
							<div class="layui-input-block">
								<select id="ctlNumberTypeDecimals" name="ctlNumberTypeDecimals" asp-for="@NumberTypeDecimals">
									<option value="-1">自动</option>
									<option value="0">0</option>
									<option value="1">1</option>
									<option value="2">2</option>
									<option value="3">3</option>
									<option value="4">4</option>
									<option value="5">5</option>
								</select>
							</div>
						</div>
						<div class="layui-form-item">
							<label class="layui-form-label">默认值</label>
							<div class="layui-input-block">
								<input type="text" class="layui-input" id="ctlNumberTypeDefaultValue" name="ctlNumberTypeDefaultValue" asp-for="DefaultValue" />
							</div>
						</div>
						<div class="layui-form-item">
							<label class="layui-form-label">以百分比显示</label>
							<div class="layui-input-block">
								<input type="checkbox" asp-for="@NumberTypePercent" name="ctlNumberTypePercent" lay-skin="switch" lay-text="是(例：50%)|否(例：50)" />
							</div>
						</div>
					</div>
					<div id="ctlFieldTypeMoneyType" style="display:none;">
						<div class="layui-form-item">
							<label class="layui-form-label">最小值</label>
							<div class="layui-input-block">
								<input type="text" class="layui-input" id="ctlMoneyTypeMinLength" name="ctlMoneyTypeMinLength" asp-for="@MoneyTypeMinLength"
									   data-val="true" data-val-regex-pattern="@RegexHelper.MoneyPattern" data-val-regex="只能是大于0的数字" />
								<span data-valmsg-for="ctlMoneyTypeMinLength" data-valmsg-replace="true" style="color:red;"></span>
							</div>
						</div>
						<div class="layui-form-item">
							<label class="layui-form-label">最大值</label>
							<div class="layui-input-block">
								<input type="text" class="layui-input" id="ctlMoneyTypeMaxLength" name="ctlMoneyTypeMaxLength" asp-for="@MoneyTypeMaxLength"
									   data-val="true" data-val-regex-pattern="@RegexHelper.MoneyPattern" data-val-regex="只能是大于0的数字"
									   data-val-compare-other="ctlMoneyTypeMinLength" data-val-compare-operator="GreaterThan" data-val-compare="最大值必须大于最小值" />
								<span data-valmsg-for="ctlMoneyTypeMaxLength" data-valmsg-replace="true" style="color:red;"></span>
							</div>
						</div>
						<div class="layui-form-item">
							<label class="layui-form-label">默认值</label>
							<div class="layui-input-block">
								<input type="text" class="layui-input" id="ctlMoneyTypeDefaultValue" name="ctlMoneyTypeDefaultValue" asp-for="DefaultValue" />
							</div>
						</div>
					</div>
					<div id="ctlFieldTypeFileType" style="display:none;">
						<div class="layui-form-item">
							<label class="layui-form-label">文件大小</label>
							<div class="layui-input-block">
								<input type="text" class="layui-input" id="ctlFileTypeFileSize" name="ctlFileTypeFileSize" asp-for="@FileTypeFileSize"
									   data-val="true" data-val-regex-pattern="@RegexHelper.NumberPattern" data-val-regex="只能是数字" />
								<span class="layui-bg-green">单位：KB。提示：1 KB = 1024 Byte，1 MB = 1024 KB</span>
								<span data-valmsg-for="ctlFileTypeFileSize" data-valmsg-replace="true" style="color:red;"></span>
							</div>
						</div>
						<div class="layui-form-item">
							<label class="layui-form-label">文件类型</label>
							<div class="layui-input-block">
								<input type="text" class="layui-input" id="ctlFileTypeFileExts" name="ctlFileTypeFileExts" asp-for="@FileTypeFileExts" />
								<span class="layui-bg-green">提示：允许多个类型请用“,”号分割，如：gif,jpg,jpeg,bmp,png,rar,zip</span>
								<span data-valmsg-for="ctlFileTypeFileExts" data-valmsg-replace="true" style="color:red;"></span>
							</div>
						</div>
						<div class="layui-form-item">
							<label class="layui-form-label">下载频道控件</label>
							<div class="layui-input-block">
								<input type="checkbox" asp-for="@FileTypeIsDownLoad" name="ctlFileTypeIsDownLoad" lay-skin="switch" lay-text="是|否" />
							</div>
						</div>
						<div class="layui-form-item">
							<label class="layui-form-label">保存文件大小</label>
							<div class="layui-input-block">
								<input type="checkbox" asp-for="@FileTypeIsSaveFileSize" name="ctlFileTypeIsSaveFileSize" lay-skin="switch" lay-text="是|否" />
							</div>
						</div>
						<div class="layui-form-item">
							<label class="layui-form-label">保存字段的名称</label>
							<div class="layui-input-block">
								<input type="text" class="layui-input" id="ctlFileTypeSizeFieldName" name="ctlFileTypeSizeFieldName" asp-for="@FileTypeSizeFieldName"
									   data-val="true" data-val-regex-pattern="@RegexHelper.FieldNamePattern" data-val-regex="由字母、数字、下划线组成，并且仅能字母开头，不以下划线结尾"
									   data-val-compare-other="FieldName" data-val-compare-operator="NotEqual" data-val-compare="保存文件大小的字段名不能与主字段名重复" />
								<span class="layui-bg-green">提示：字段名由字母、数字、下划线组成，并且仅能字母开头，不以下划线结尾。</span>
								<span data-valmsg-for="ctlFileTypeSizeFieldName" data-valmsg-replace="true" style="color:red;"></span>
							</div>
						</div>
						<div class="layui-form-item">
							<label class="layui-form-label">文件名保存规则</label>
							<div class="layui-input-block">
								<select id="ctlFileTypeFileNameRule" name="ctlFileTypeFileNameRule" asp-for="@FileTypeFileNameRule">
									<option value="{$Random}">随机数</option>
									<option value="{$Year}{$Month}{$Day}{$Hour}{$Minute}{$Second}">年月日时分秒</option>
									<option value="{$Hour}{$Minute}{$Second}">时分秒</option>
									<option value="{$Origin}">原名称</option>
								</select>
							</div>
						</div>
						<div class="layui-form-item">
							<label class="layui-form-label">地址前缀</label>
							<div class="layui-input-block">
								<input type="text" class="layui-input" id="ctlFileTypeFileUrlPrdfix" name="ctlFileTypeFileUrlPrdfix" asp-for="@FileTypeFileUrlPrdfix" />
							</div>
						</div>
						<div class="layui-form-item">
							<label class="layui-form-label">上传文件最大数</label>
							<div class="layui-input-block">
								<input type="text" class="layui-input" id="ctlFileTypeFileMaxCount" name="ctlFileTypeFileMaxCount" asp-for="@FileTypeFileMaxCount"
									   data-val="true" data-val-regex-pattern="@RegexHelper.NumberPattern" data-val-regex="只能是整数" />
								<span data-valmsg-for="ctlFileTypeFileMaxCount" data-valmsg-replace="true" style="color:red;"></span>
							</div>
						</div>
						<div class="layui-form-item">
							<label class="layui-form-label">默认值</label>
							<div class="layui-input-block">
								<input type="text" class="layui-input" id="ctlFileTypeDefaultValue" name="ctlFileTypeDefaultValue" asp-for="DefaultValue" />
							</div>
						</div>
					</div>
					<div id="ctlFieldTypePictureType" style="display:none;">
						<div class="layui-form-item">
							<label class="layui-form-label">图片大小</label>
							<div class="layui-input-block">
								<input type="text" class="layui-input" id="ctlPictureTypeImageSize" name="ctlPictureTypeImageSize" asp-for="@PictureTypeImageSize"
									   data-val="true" data-val-regex-pattern="@RegexHelper.NumberPattern" data-val-regex="只能是数字" />
								<span class="layui-bg-green">单位：KB。提示：1 KB = 1024 Byte，1 MB = 1024 KB</span>
								<span data-valmsg-for="ctlPictureTypeImageSize" data-valmsg-replace="true" style="color:red;"></span>
							</div>
						</div>
						<div class="layui-form-item">
							<label class="layui-form-label">图片类型</label>
							<div class="layui-input-block">
								<input type="text" class="layui-input" id="ctlPictureTypeImageExts" name="ctlPictureTypeImageExts" asp-for="@PictureTypeImageExts" />
								<span class="layui-bg-green">提示：允许多个类型请用“,”号分割，如：gif,jpg,jpeg,bmp,png</span>
								<span data-valmsg-for="ctlPictureTypeImageExts" data-valmsg-replace="true" style="color:red;"></span>
							</div>
						</div>
						<div class="layui-form-item">
							<label class="layui-form-label">是否加水印</label>
							<div class="layui-input-block">
								<input type="checkbox" asp-for="@PictureTypeIsWaterMark" name="ctlPictureTypeIsWaterMark" lay-skin="switch" lay-text="是|否" />
							</div>
						</div>
						<div class="layui-form-item">
							<label class="layui-form-label">是否生成缩略图</label>
							<div class="layui-input-block">
								<input type="checkbox" asp-for="@PictureTypeIsThumb" name="ctlPictureTypeIsThumb" lay-skin="switch" lay-text="是|否" />
							</div>
						</div>
						<div class="layui-form-item">
							<label class="layui-form-label">默认值</label>
							<div class="layui-input-block">
								<input type="text" class="layui-input" id="ctlPictureTypeDefaultValue" name="ctlPictureTypeDefaultValue" asp-for="DefaultValue" />
							</div>
						</div>
					</div>
					<div id="ctlFieldTypeMultiplePhotoType" style="display:none;">
						<div class="layui-form-item">
							<label class="layui-form-label">图片大小</label>
							<div class="layui-input-block">
								<input type="text" class="layui-input" id="ctlMultiplePhotoTypeImageSize" name="ctlMultiplePhotoTypeImageSize" asp-for="@MultiplePhotoTypeImageSize"
									   data-val="true" data-val-regex-pattern="@RegexHelper.NumberPattern" data-val-regex="只能是数字" />
								<span class="layui-bg-green">单位：KB。提示：1 KB = 1024 Byte，1 MB = 1024 KB</span>
								<span data-valmsg-for="ctlMultiplePhotoTypeImageSize" data-valmsg-replace="true" style="color:red;"></span>
							</div>
						</div>
						<div class="layui-form-item">
							<label class="layui-form-label">图片类型</label>
							<div class="layui-input-block">
								<input type="text" class="layui-input" id="ctlMultiplePhotoTypeImageExts" name="ctlMultiplePhotoTypeImageExts" asp-for="@MultiplePhotoTypeImageExts" />
								<span class="layui-bg-green">提示：允许多个类型请用“,”号分割，如：gif,jpg,jpeg,bmp,png</span>
								<span data-valmsg-for="ctlMultiplePhotoTypeImageExts" data-valmsg-replace="true" style="color:red;"></span>
							</div>
						</div>
						<div class="layui-form-item">
							<label class="layui-form-label">是否加水印</label>
							<div class="layui-input-block">
								<input type="checkbox" asp-for="@MultiplePhotoTypeIsWaterMark" name="ctlMultiplePhotoTypeIsWaterMark" lay-skin="switch" lay-text="是|否" />
							</div>
						</div>
						<div class="layui-form-item">
							<label class="layui-form-label">默认值</label>
							<div class="layui-input-block">
								<input type="text" class="layui-input" id="ctlMultiplePhotoTypeDefaultValue" name="ctlMultiplePhotoTypeDefaultValue" asp-for="DefaultValue" />
							</div>
						</div>
					</div>
					<div id="ctlFieldTypeListBoxType" style="display:none;">
						<div class="layui-form-item">
							<label class="layui-form-label">每个选项</label>
							<div class="layui-input-block">
								<select id="ctlListBoxTypeDataList" name="ctlListBoxTypeDataList"
										class="select" size="5" lay-ignore
										asp-items="ListBoxTypeDataList">
								</select>
								<span class="layui-bg-green">说明：显示数据|保存数据，如果添加空数据可写“无|”</span>
								<p>
									<input type="button" value="向上" onclick="UpOrder('ctlListBoxTypeDataList');" class="layui-btn layui-btn-xs layuiadmin-btn-list" />
									<input type="button" value="向下" onclick="DownOrder('ctlListBoxTypeDataList');" class="layui-btn layui-btn-xs layuiadmin-btn-list" />
									<input type="button" value="添加" onclick="AddUrl('ctlListBoxTypeDataList');" class="layui-btn layui-btn-xs layuiadmin-btn-list" />
									<input type="button" value="修改" onclick="return ModifyUrl('ctlListBoxTypeDataList');" class="layui-btn layui-btn-xs layuiadmin-btn-list" />
									<input type="button" value="删除" onclick="DelUrl('ctlListBoxTypeDataList');" class="layui-btn layui-btn-xs layuiadmin-btn-list" />
									<input type="hidden" id="hidListBoxTypeDataList" name="hidListBoxTypeDataList" value="" />
								</p>
							</div>
						</div>
						<div class="layui-form-item">
							<label class="layui-form-label">显示类型</label>
							<div class="layui-input-block">
								<select id="ctlListBoxTypeShowType" name="ctlListBoxTypeShowType" asp-for="@ListBoxTypeShowType">
									<option value="1">单选下拉列表框</option>
									<option value="2">多选下拉列表框</option>
									<option value="3">单选按钮</option>
									<option value="4">复选框</option>
								</select>
							</div>
						</div>
						<div class="layui-form-item">
							<label class="layui-form-label">每行显示项数</label>
							<div class="layui-input-block">
								<input type="text" class="layui-input" id="ctlListBoxTypeRepeatColumns" name="ctlListBoxTypeRepeatColumns" asp-for="@ListBoxTypeRepeatColumns"
									   data-val="true" data-val-regex-pattern="@RegexHelper.NumberPattern" data-val-regex="只能是整数" />
								<span class="layui-bg-green">说明：只当类型为单选按钮或复选框时起作用</span>
								<span data-valmsg-for="ctlListBoxTypeRepeatColumns" data-valmsg-replace="true" style="color:red;"></span>
							</div>
						</div>
						<div class="layui-form-item">
							<label class="layui-form-label">默认值</label>
							<div class="layui-input-block">
								<input type="text" class="layui-input" id="ctlListBoxTypeDefaultValue" name="ctlListBoxTypeDefaultValue" asp-for="DefaultValue" />
							</div>
						</div>
					</div>
					<div id="ctlFieldTypeListBoxIntroType" style="display:none;">
						<div class="layui-form-item">
							<label class="layui-form-label">每个选项</label>
							<div class="layui-input-block">
								<select id="ctlListBoxIntroTypeDataList" name="ctlListBoxIntroTypeDataList"
										class="select" size="5" lay-ignore
										asp-items="ListBoxIntroTypeDataList">
								</select>
								<span class="layui-bg-green">说明：显示数据|保存数据，如果添加空数据可写“无|”</span>
								<p>
									<input type="button" value="向上" onclick="UpOrder('ctlListBoxIntroTypeDataList');" class="layui-btn layui-btn-xs layuiadmin-btn-list" />
									<input type="button" value="向下" onclick="DownOrder('ctlListBoxIntroTypeDataList');" class="layui-btn layui-btn-xs layuiadmin-btn-list" />
									<input type="button" value="添加" onclick="AddUrl('ctlListBoxIntroTypeDataList');" class="layui-btn layui-btn-xs layuiadmin-btn-list" />
									<input type="button" value="修改" onclick="return ModifyUrl('ctlListBoxIntroTypeDataList');" class="layui-btn layui-btn-xs layuiadmin-btn-list" />
									<input type="button" value="删除" onclick="DelUrl('ctlListBoxIntroTypeDataList');" class="layui-btn layui-btn-xs layuiadmin-btn-list" />
									<input type="hidden" id="hidListBoxIntroTypeDataList" name="hidListBoxIntroTypeDataList" value="" />
								</p>
							</div>
						</div>
						<div class="layui-form-item">
							<label class="layui-form-label">显示类型</label>
							<div class="layui-input-block">
								<select id="ctlListBoxIntroTypeShowType" name="ctlListBoxIntroTypeShowType" asp-for="@ListBoxIntroTypeShowType">
									<option value="1">单选按钮</option>
									<option value="2">复选框</option>
								</select>
							</div>
						</div>
						<div class="layui-form-item">
							<label class="layui-form-label">每行显示项数</label>
							<div class="layui-input-block">
								<input type="text" class="layui-input" id="ctlListBoxIntroTypeRepeatColumns" name="ctlListBoxIntroTypeRepeatColumns" asp-for="@ListBoxIntroTypeRepeatColumns"
									   data-val="true" data-val-regex-pattern="@RegexHelper.NumberPattern" data-val-regex="只能是整数" />
								<span class="layui-bg-green">说明：只当类型为单选按钮或复选框时起作用</span>
								<span data-valmsg-for="ctlListBoxIntroTypeRepeatColumns" data-valmsg-replace="true" style="color:red;"></span>
							</div>
						</div>
						<div class="layui-form-item">
							<label class="layui-form-label">默认值</label>
							<div class="layui-input-block">
								<input type="text" class="layui-input" id="ctlListBoxIntroTypeDefaultValue" name="ctlListBoxIntroTypeDefaultValue" asp-for="DefaultValue" />
							</div>
						</div>
					</div>
					<div id="ctlFieldTypeListBoxDataType" style="display:none;">
						<div class="layui-form-item">
							<label class="layui-form-label">SQL语句</label>
							<div class="layui-input-block">
								<input type="text" class="layui-input" id="ctlListBoxDataTypeSQL" name="ctlListBoxDataTypeSQL" asp-for="@ListBoxDataTypeSQL" />
								<span data-valmsg-for="ctlListBoxDataTypeSQL" data-valmsg-replace="true" style="color:red;"></span>
							</div>
						</div>
						<div class="layui-form-item">
							<label class="layui-form-label">文本字段名</label>
							<div class="layui-input-block">
								<input type="text" class="layui-input" id="ctlListBoxDataTypeTextField" name="ctlListBoxDataTypeTextField" asp-for="@ListBoxDataTypeTextField" />
								<span data-valmsg-for="ctlListBoxDataTypeTextField" data-valmsg-replace="true" style="color:red;"></span>
							</div>
						</div>
						<div class="layui-form-item">
							<label class="layui-form-label">值字段名</label>
							<div class="layui-input-block">
								<input type="text" class="layui-input" id="ctlListBoxDataTypeValueField" name="ctlListBoxDataTypeValueField" asp-for="@ListBoxDataTypeValueField" />
								<span data-valmsg-for="ctlListBoxDataTypeValueField" data-valmsg-replace="true" style="color:red;"></span>
							</div>
						</div>
						<div class="layui-form-item">
							<label class="layui-form-label">值字段类型</label>
							<div class="layui-input-block">
								<select id="ctlListBoxDataTypeValueFieldType" name="ctlListBoxDataTypeValueFieldType" asp-for="@ListBoxDataTypeValueFieldType">
									<option value="Int">整数</option>
									<option value="String">字符串</option>
								</select>
								<span class="layui-bg-green">说明：整数类型只适合单选下拉列表框和单选按钮</span>
							</div>
						</div>
						<div class="layui-form-item">
							<label class="layui-form-label">显示类型</label>
							<div class="layui-input-block">
								<select id="ctlListBoxDataTypeShowType" name="ctlListBoxDataTypeShowType" asp-for="@ListBoxDataTypeShowType">
									<option value="1">单选下拉列表框</option>
									<option value="2">多选下拉列表框</option>
									<option value="3">单选按钮</option>
									<option value="4">复选框</option>
								</select>
							</div>
						</div>
						<div class="layui-form-item">
							<label class="layui-form-label">显示“请选择”</label>
							<div class="layui-input-block">
								<input type="checkbox" asp-for="@ListBoxDataTypeIsFillData" id="ctlListBoxDataTypeIsFillData" name="ctlListBoxDataTypeIsFillData" lay-skin="switch" lay-text="是|否">
							</div>
						</div>
						<div class="layui-form-item">
							<label class="layui-form-label">每行显示项数</label>
							<div class="layui-input-block">
								<input type="text" class="layui-input" id="ctlListBoxDataTypeRepeatColumns" name="ctlListBoxDataTypeRepeatColumns" asp-for="@ListBoxDataTypeRepeatColumns"
									   data-val="true" data-val-regex-pattern="@RegexHelper.NumberPattern" data-val-regex="只能是整数" />
								<span class="layui-bg-green">说明：只当类型为单选按钮或复选框时起作用</span>
								<span data-valmsg-for="ctlListBoxDataTypeRepeatColumns" data-valmsg-replace="true" style="color:red;"></span>
							</div>
						</div>
						<div class="layui-form-item">
							<label class="layui-form-label">默认值</label>
							<div class="layui-input-block">
								<input type="text" class="layui-input" id="ctlListBoxDataTypeDefaultValue" name="ctlListBoxDataTypeDefaultValue" asp-for="DefaultValue" />
							</div>
						</div>
					</div>
					<div id="ctlFieldTypeBoolType" style="display:none;">
						<div class="layui-form-item">
							<label class="layui-form-label">选择“是”的文本</label>
							<div class="layui-input-block">
								<input type="text" class="layui-input" id="ctlBoolTypeTrueText" name="ctlBoolTypeTrueText" asp-for="@BoolTypeTrueText" />
								<span data-valmsg-for="ctlBoolTypeTrueText" data-valmsg-replace="true" style="color:red;"></span>
							</div>
						</div>
						<div class="layui-form-item">
							<label class="layui-form-label">选择“否”的文本</label>
							<div class="layui-input-block">
								<input type="text" class="layui-input" id="ctlBoolTypeFalseText" name="ctlBoolTypeFalseText" asp-for="@BoolTypeFalseText" />
								<span data-valmsg-for="ctlBoolTypeFalseText" data-valmsg-replace="true" style="color:red;"></span>
							</div>
						</div>
						<div class="layui-form-item">
							<label class="layui-form-label">默认值</label>
							<div class="layui-input-block">
								<select id="ctlBoolTypeDefaultValue" name="ctlBoolTypeDefaultValue" asp-for="DefaultValue">
									<option value="true">是</option>
									<option value="false">否</option>
								</select>
							</div>
						</div>
					</div>
					<div id="ctlFieldTypeDateTimeType" style="display:none;">
						<div class="layui-form-item">
							<label class="layui-form-label">日期格式</label>
							<div class="layui-input-block">
								<select id="ctlDateTimeTypeFormat" name="ctlDateTimeTypeFormat" asp-for="@DateTimeTypeFormat">
									<option value="datetime">年-月-日 时-分-秒</option>
									<option value="time">时-分-秒</option>
									<option value="date">年-月-日</option>
									<option value="month">年-月</option>
									<option value="year">年</option>
								</select>
							</div>
						</div>
						<div class="layui-form-item">
							<label class="layui-form-label">默认值类型</label>
							<div class="layui-input-block">
								<select id="ctlDateTimeTypeDefaultType" name="ctlDateTimeTypeDefaultType" asp-for="@DateTimeTypeDefaultType">
									<option value="0">无</option>
									<option value="1">当前日期</option>
									<option value="2">指定日期</option>
								</select>
							</div>
						</div>
						<div class="layui-form-item">
							<label class="layui-form-label">默认值</label>
							<div class="layui-input-block">
								<input type="text" class="layui-input" id="ctlDateTimeTypeDefaultValue" name="ctlDateTimeTypeDefaultValue" asp-for="DefaultValue" />
								<span class="layui-bg-green">说明：默认值类型为指定日期时起作用</span>
							</div>
						</div>
						<div class="layui-form-item">
							<label class="layui-form-label">开启区域选择</label>
							<div class="layui-input-block">
								<input type="checkbox" asp-for="@DateTimeTypeIsRange" name="ctlDateTimeTypeIsRange" lay-skin="switch" lay-text="是|否" />
							</div>
						</div>
					</div>
					<div id="ctlFieldTypeLinkType" style="display:none;">
						<div class="layui-form-item">
							<label class="layui-form-label">默认值</label>
							<div class="layui-input-block">
								<input type="text" class="layui-input" id="ctlLinkTypeDefaultValue" name="ctlLinkTypeDefaultValue" asp-for="DefaultValue" />
							</div>
						</div>
					</div>
					<div id="ctlFieldTypeColorType" style="display:none;">
						<div class="layui-form-item">
							<label class="layui-form-label">默认值</label>
							<div class="layui-input-block">
								<input type="text" class="layui-input" id="ctlColorTypeDefaultValue" name="ctlColorTypeDefaultValue" asp-for="DefaultValue" />
							</div>
						</div>
					</div>
					<div id="ctlFieldTypeLookType" style="display:none;">
						<div class="layui-form-item">
							<label class="layui-form-label">信息来自模型</label>
							<div class="layui-input-block">
								<select id="ctlLookTypeModelID" name="ctlLookTypeModelID" lay-filter="SelectLookTypeModel"
										asp-items="selectItemListLookType" asp-for="@LookTypeModelID">
								</select>
							</div>
						</div>
						<div class="layui-form-item">
							<label class="layui-form-label">对应的字段名</label>
							<div class="layui-input-block">
								<select id="ctlLookTypeFieldName" name="ctlLookTypeFieldName"
										asp-items="selectItemListLookTypeFieldName" asp-for="@LookTypeFieldName">
								</select>
							</div>
						</div>
						<div class="layui-form-item">
							<label class="layui-form-label">默认值</label>
							<div class="layui-input-block">
								<input type="text" class="layui-input" id="ctlLookTypeDefaultValue" name="ctlLookTypeDefaultValue" asp-for="DefaultValue" />
							</div>
						</div>
					</div>
					<div id="ctlFieldTypeOperatingType" style="display:none;">
						<div class="layui-form-item">
							<label class="layui-form-label">默认项</label>
							<div class="layui-input-block">
								<textarea class="layui-textarea" id="ctlOperatingTypeSelectItem" name="ctlOperatingTypeSelectItem" asp-for="@OperatingTypeSelectItem"></textarea>
								<span class="layui-bg-green">说明：一行一个默认项</span>
							</div>
						</div>
						<div class="layui-form-item">
							<label class="layui-form-label">保存上次记录</label>
							<div class="layui-input-block">
								<input type="checkbox" asp-for="@OperatingTypeIsSave" name="ctlOperatingTypeIsSave" lay-skin="switch" lay-text="是|否" />
							</div>
						</div>
						<div class="layui-form-item">
							<label class="layui-form-label">默认值</label>
							<div class="layui-input-block">
								<input type="text" class="layui-input" id="ctlOperatingTypeDefaultValue" name="ctlOperatingTypeDefaultValue" asp-for="DefaultValue" />
							</div>
						</div>
					</div>
					<div id="ctlFieldTypeNumBuilder" style="display:none;">
						<div class="layui-form-item">
							<label class="layui-form-label">默认值</label>
							<div class="layui-input-block">
								<input type="text" class="layui-input" id="ctlNumBuilderDefaultValue" name="ctlNumBuilderDefaultValue" asp-for="DefaultValue" />
							</div>
						</div>
					</div>
					<div id="ctlFieldTypeRegionType" style="display:none;">
						<div class="layui-form-item">
							<label class="layui-form-label">显示方式</label>
							<div class="layui-input-block">
								<select id="ctlRegionTypeShowType" name="ctlRegionTypeShowType" asp-for="@RegionTypeShowType">
									<option value="4">省+市</option>
									<option value="5">省+市+县</option>
									<option value="6">市+县(默认值设置：省必须设置，市县可以不设置)</option>
								</select>
							</div>
						</div>
						<div class="layui-form-item">
							<label class="layui-form-label">显示方式默认值</label>
							<div class="layui-input-block">
								@await Component.InvokeAsync("Region", new RegionViewModel { Prefix = "RegionType.", Province = RegionTypeSelectProvince, City = RegionTypeSelectCity, Area = RegionTypeSelectArea })
							</div>
						</div>
					</div>
					<div id="ctlFieldTypeRegionTypeText" style="display:none;">
						<div class="layui-form-item">
							<label class="layui-form-label">显示方式</label>
							<div class="layui-input-block">
								<select id="ctlRegionTypeTextShowType" name="ctlRegionTypeTextShowType" asp-for="@RegionTypeTextShowType">
									<option value="4">省+市</option>
									<option value="5">省+市+县</option>
									<option value="6">市+县(默认值设置：省必须设置，市县可以不设置)</option>
								</select>
							</div>
						</div>
						<div class="layui-form-item">
							<label class="layui-form-label">显示方式默认值</label>
							<div class="layui-input-block">
								@await Component.InvokeAsync("Region", new RegionViewModel { Prefix = "RegionTypeText.", Province = RegionTypeTextSelectProvince, City = RegionTypeTextSelectCity, Area = RegionTypeTextSelectArea })
							</div>
						</div>
						<div class="layui-form-item">
							<label class="layui-form-label">详细地址</label>
							<div class="layui-input-block">
								<input type="text" class="layui-input" id="ctlRegionTypeTextSelectAddress" name="ctlRegionTypeTextSelectAddress" asp-for="@RegionTypeTextSelectAddress" />
							</div>
						</div>
					</div>
					<div id="ctlFieldTypeRegionTypeFive" style="display:none;">
						<div class="layui-form-item">
							<label class="layui-form-label">显示方式</label>
							<div class="layui-input-block">
								<select id="ctlRegionTypeFiveShowType" name="ctlRegionTypeFiveShowType" asp-for="@RegionTypeFiveShowType">
									<option value="1">国家+省+市+县+街道+小区</option>
									<option value="2" selected="selected">省+市+县+街道+小区</option>
									<option value="3">市+县+街道+小区</option>
								</select>
							</div>
						</div>
						<div class="layui-form-item">
							<label class="layui-form-label">显示方式默认值</label>
							<div class="layui-input-block">
								@await Component.InvokeAsync("Region", new RegionViewModel { Prefix = "RegionTypeFive.", Province = RegionTypeFiveSelectProvince, City = RegionTypeFiveSelectCity, Area = RegionTypeFiveSelectArea })
							</div>
						</div>
					</div>
					<div id="ctlFieldTypeRegionTypeSelect" style="display:none;">
						<div class="layui-form-item">
							<label class="layui-form-label">显示方式默认值</label>
							<div class="layui-input-block">
								@await Component.InvokeAsync("Region", new RegionViewModel { Prefix = "RegionTypeSelect.", Province = RegionTypeSelectSelectProvince, City = RegionTypeSelectSelectCity, Area = RegionTypeSelectSelectArea })
							</div>
						</div>
					</div>
					<div id="ctlFieldTypeContentType" style="display:none;">
						<div class="layui-form-item">
							<label class="layui-form-label">默认值</label>
							<div class="layui-input-block">
								@await Component.InvokeAsync("UEditor", new UEditorViewModel { ClientID = "ctlContentTypeDefaultValue", Content = Model.DefaultValue })
							</div>
						</div>
					</div>
					<div id="ctlFieldTypeSelectUserType" style="display:none;">
						<div class="layui-form-item">
							<label class="layui-form-label">默认值</label>
							<div class="layui-input-block">
								<input type="text" class="layui-input" id="ctlSelectUserTypeDefaultValue" name="ctlSelectUserTypeDefaultValue" asp-for="DefaultValue" />
							</div>
						</div>
					</div>
					<div id="ctlFieldTypeIndustryCategory" style="display:none;">
						<div class="layui-form-item">
							<label class="layui-form-label">根节点ID</label>
							<div class="layui-input-block">
								<input type="text" class="layui-input" id="ctlIndustryCategoryRootID" name="ctlIndustryCategoryRootID" asp-for="@IndustryCategoryRootID"
									   data-val="true" data-val-regex-pattern="@RegexHelper.NumberPattern" data-val-regex="只能是整数" />
								<span data-valmsg-for="ctlIndustryCategoryRootID" data-valmsg-replace="true" style="color:red;"></span>
							</div>
						</div>
					</div>
					<div id="ctlFieldTypeProducer" style="display:none;">
						<div class="layui-form-item">
							<label class="layui-form-label">默认值</label>
							<div class="layui-input-block">
								<input type="text" class="layui-input" id="ctlProducerDefaultValue" name="ctlProducerDefaultValue" asp-for="DefaultValue" />
							</div>
						</div>
					</div>
					<div id="ctlFieldTypeTrademark" style="display:none;">
						<div class="layui-form-item">
							<label class="layui-form-label">默认值</label>
							<div class="layui-input-block">
								<input type="text" class="layui-input" id="ctlTrademarkDefaultValue" name="ctlTrademarkDefaultValue" asp-for="DefaultValue" />
							</div>
						</div>
					</div>
					<div id="ctlFieldTypeProperty" style="display:none;">
						<div class="layui-form-item">
							<label class="layui-form-label">属性值</label>
							<div class="layui-input-block">
								<input type="text" class="layui-input" id="ctlPropertySelectValue" name="ctlPropertySelectValue" asp-for="@PropertySelectValue" />
								<span class="layui-bg-green">说明：多个值之间用“|”分隔，不能带有半角的“$”、“*”字符</span>
								<span data-valmsg-for="ctlPropertySelectValue" data-valmsg-replace="true" style="color:red;"></span>
							</div>
						</div>
					</div>
					<div id="ctlFieldTypeProductStyle" style="display:none;">
						<div class="layui-form-item">
							<label class="layui-form-label">属性值</label>
							<div class="layui-input-block">
								<input type="text" class="layui-input" id="ctlProductStyleSelectValue" name="ctlProductStyleSelectValue" asp-for="@ProductStyleSelectValue" />
								<span class="layui-bg-green">说明：多个值之间用“|”分隔，不能带有半角的“$”、“*”字符</span>
								<span data-valmsg-for="ctlProductStyleSelectValue" data-valmsg-replace="true" style="color:red;"></span>
							</div>
						</div>
					</div>
					<div id="ctlFieldTypeTitleType" style="display:none;">
						<div class="layui-form-item">
							<label class="layui-form-label">最大字符数</label>
							<div class="layui-input-block">
								<input type="text" class="layui-input" id="ctlTitleTypeMaxLength" name="ctlTitleTypeMaxLength" asp-for="@TitleTypeMaxLength"
									   data-val="true" data-val-regex-pattern="@RegexHelper.NumberPattern" data-val-regex="只能是整数" />
								<span data-valmsg-for="ctlTitleTypeMaxLength" data-valmsg-replace="true" style="color:red;"></span>
							</div>
						</div>
						<div class="layui-form-item">
							<label class="layui-form-label">检测重复值</label>
							<div class="layui-input-block">
								<input type="checkbox" asp-for="@TitleTypeCheckIsExist" name="ctlTitleTypeCheckIsExist" lay-skin="switch" lay-text="是|否" />
							</div>
						</div>
						<div class="layui-form-item">
							<label class="layui-form-label">生成字母标题</label>
							<div class="layui-input-block">
								<input type="checkbox" asp-for="@TitleTypeCreatePY" name="ctlTitleTypeCreatePY" lay-skin="switch" lay-text="是|否" />
							</div>
						</div>
						<div class="layui-form-item">
							<label class="layui-form-label">默认值</label>
							<div class="layui-input-block">
								<input type="text" class="layui-input" id="ctlTitleTypeDefaultValue" name="ctlTitleTypeDefaultValue" asp-for="DefaultValue" />
							</div>
						</div>
					</div>
					<div class="layui-form-item">
						<label class="layui-form-label">禁止设置该字段值的会员组</label>
						<div class="layui-input-block">
							<select id="ctlGroupList" name="ctlGroupList" class="layui-input" style="padding:0px;" lay-ignore></select>
						</div>
					</div>
					<div class="layui-form-item">
						<label class="layui-form-label">禁止设置该字段值的角色</label>
						<div class="layui-input-block">
							<select id="ctlRoleList" name="ctlRoleList" class="layui-input" style="padding:0px;" lay-ignore></select>
						</div>
					</div>
					<div class="layui-form-item">
						<div class="layui-input-block">
							<button type="submit" class="layui-btn layuiadmin-btn-list" lay-submit lay-filter="mySubmit">保存</button>
							<button type="button" class="layui-btn layuiadmin-btn-list" onclick="layer_close()">取消</button>
							<input type="hidden" id="mAction" name="mAction" value="@ViewBag.mAction" />
							<input type="hidden" id="ModelType" name="ModelType" value="@ViewBag.ModelType" />
							<input type="hidden" id="ModelID" name="ModelID" value="@ViewBag.ModelID" />
							<input type="hidden" asp-for="OrderId" />
							<input type="hidden" asp-for="FieldLevel" />
							<input type="hidden" asp-for="FieldType" />
							<span style="color:red; font-size:18px;">@Html.ValidationSummary(true)</span>
						</div>
					</div>
					@Html.AntiForgeryToken()
				</form>
			</div>
		</div>
	</div>
</div>
@section scripts{
	<script type="text/javascript">
		layui.use(['form'], function () {
			var form = layui.form;
			//监听选择字段类型
			form.on('radio(SelectFieldType)', function (data) {
				$("#FieldType").val(data.value);
				ShowFieldType();
			});
			//监听选择验证规则
			form.on('select(SelectRegexRule)', function (data) {
				$("#ctlTextTypeRegexRule").val(data.value);
				if (data.value != "") {
					$("#ctlTextTypeRegexRule").show();
				} else {
					$("#ctlTextTypeRegexRule").hide();
				}
			});
			//监听选择模型
			form.on('select(SelectLookTypeModel)', function (data) {
				$.ajax({
					type: "GET",
					url: "/Admin/CommonModel/GetFieldNamesByTextType",
					data: { "ModelID": data.value },
					contentType: "application/x-www-form-urlencoded;charset=UTF-8",
					success: function (res) {
						var option = "";
						$.each(res, function (i, item) {
							option += "<option value='" + item.FieldName + "'>" + item.FieldAlias + "</option>";
						});
						if (option == "") {
							option = "<option value=''>请选择</option>";
						}
						$("#ctlLookTypeFieldName").html(option);
						form.render('select');
					}
				});
			});
			//监听提交
			form.on('submit(mySubmit)', function (data) {
				var flag = true;
				switch (data.field.FieldType) {
					case "ListBoxType":
						flag = ChangeHiddenFieldValue("hidListBoxTypeDataList", "ctlListBoxTypeDataList","ctlListBoxTypeDefaultValue");
						break;
					case "ListBoxIntroType":
						flag = ChangeHiddenFieldValue("hidListBoxIntroTypeDataList", "ctlListBoxIntroTypeDataList", "ctlListBoxIntroTypeDefaultValue");
						break;
				}
				return flag;
			});
		});
		function ChangeHiddenFieldValue(hidID, clientId, defaultClientId) {
			var obj = document.getElementById(hidID);
			var choiceUrl = document.getElementById(clientId);
			var Default = document.getElementById(defaultClientId).value;
			var bFoundMatchWithDefault = false;

			var value = "";
			if (choiceUrl.length < 1) {
				layer.msg("请添加选项！");
				return false;
			}

			for (i = 0; i < choiceUrl.length; i++) {
				if (value != "") {
					value = value + "$$$";
				}
				value = value + choiceUrl.options[i].value;

				if (Default == choiceUrl.options[i].value.split("|")[1]) {
					bFoundMatchWithDefault = true;
				}
			}
			obj.value = value;

			if (Default && !bFoundMatchWithDefault) {
				layer.msg("“选项”域的默认值必须从指定的选项中选择。请再试一次。");
				return false;
			}
			else {
				obj.value = value;
				return true;
			}
			return true;
		}
		function UpOrder(clientId) {
			var sel = document.getElementById(clientId);
			if (sel.selectedIndex >= 0) {
				var tempValue = sel.options[sel.selectedIndex].value;
				var tempText = sel.options[sel.selectedIndex].text;
			} else { return; }

			if (sel.selectedIndex > 0) {
				sel.options[sel.selectedIndex].text = sel.options[sel.selectedIndex - 1].text;
				sel.options[sel.selectedIndex - 1].text = tempText;
				sel.options[sel.selectedIndex].value = sel.options[sel.selectedIndex - 1].value;
				sel.options[sel.selectedIndex - 1].value = tempValue;
				sel.selectedIndex = sel.selectedIndex - 1;
			}
			if (sel.onchange) {
				sel.onchange();
			}
		}
		function DownOrder(clientId) {
			var sel = document.getElementById(clientId);
			if (sel.selectedIndex >= 0) {
				var tempValue = sel.options[sel.selectedIndex].value;
				var tempText = sel.options[sel.selectedIndex].text;
			} else { return; }
			if (sel.selectedIndex < sel.options.length - 1) {
				sel.options[sel.selectedIndex].text = sel.options[sel.selectedIndex + 1].text;
				sel.options[sel.selectedIndex + 1].text = tempText;
				sel.options[sel.selectedIndex].value = sel.options[sel.selectedIndex + 1].value;
				sel.options[sel.selectedIndex + 1].value = tempValue;
				sel.selectedIndex = sel.selectedIndex + 1;
			}
			if (sel.onchange) {
				sel.onchange();
			}
		}
		function AddUrl(clientId) {
			var thisurl = '选项名称|选项值';
			var url = prompt('请输入选项名称和值，中间用“|”隔开：', thisurl);
			if (url != null && url != '') {
				document.getElementById(clientId).options[document.getElementById(clientId).length] = new Option(url, url);
			}
		}
		function ModifyUrl(clientId) {
			if (document.getElementById(clientId).length == 0) return false;
			var thisurl = document.getElementById(clientId).value;
			if (thisurl == '') {
				layer.msg('请先选择一个选项，再点修改按钮！');
				return false;
			}
			var url = prompt('请输入选项名称和值，中间用“|”隔开：', thisurl);
			if (url != thisurl && url != null && url != '') {
				document.getElementById(clientId).options[document.getElementById(clientId).selectedIndex] = new Option(url, url);
			}
		}
		function DelUrl(clientId) {
			if (document.getElementById(clientId).length == 0) return false;
			var thisurl = document.getElementById(clientId).value;
			if (thisurl == '') {
				layer.msg('请先选择一个选项，再点删除按钮！');
				return false;
			}
			document.getElementById(clientId).options[document.getElementById(clientId).selectedIndex] = null;
		}
		function InitSelect(selectId,DataList) {
			if (!DataList || DataList == "") {
				return;
			}
			initSelect2(selectId, DataList, "", false);
		}
		function InitFieldSetting(fieldType) {
			$("input:radio[name='RadFieldType']").attr("disabled", true);
			$("input:radio[name='RadFieldType'][value='" + fieldType+"']").removeAttr("disabled");
			switch (fieldType) {
				case "TextType":
				case "MultipleTextType":
				case "MultipleHtmlTextType":
				case "ListBoxType":
				case "ListBoxIntroType":
				case "ColorType":
					$("input:radio[name='RadFieldType'][value='TextType']").removeAttr("disabled");
					$("input:radio[name='RadFieldType'][value='MultipleTextType']").removeAttr("disabled");
					$("input:radio[name='RadFieldType'][value='MultipleHtmlTextType']").removeAttr("disabled");
					$("input:radio[name='RadFieldType'][value='ListBoxType']").removeAttr("disabled");
					$("input:radio[name='RadFieldType'][value='ListBoxIntroType']").removeAttr("disabled");
					$("input:radio[name='RadFieldType'][value='ColorType']").removeAttr("disabled");
					break;
			}
			layui.form.render('radio');
		}
		function ShowFieldType() {
			var fieldType = $("#FieldType").val();
			$("div[id^='ctlFieldType']").each(function () {
				$(this).hide();
			});
			$("#ctlFieldType" + fieldType).show();
			$("#ctlAttachField").hide();
			switch (fieldType) {
				case "TextType":
				case "MultipleTextType":
				case "MultipleHtmlTextType":
					$("#ctlAttachField").show();
					break;
			}
		}
		function SetRadioFieldType(fieldType) {
			$("input:radio[name='RadFieldType']").attr("checked", false);
			$("input:radio[name='RadFieldType'][value='" + fieldType + "']").attr("checked", true);
			layui.form.render('radio');
		}
		$(function () {
			loadUserGroupsAjax("ctlGroupList", "@SelectGroupID", true);
			loadRolesAjax("ctlRoleList", "@SelectRoleID", true,false);
			var fieldType = $("#FieldType").val();
			SetRadioFieldType(fieldType);
			ShowFieldType();
			if ($("#mAction").val() == "Modify" || $("#mAction").val() == "Copy") {
				InitFieldSetting(fieldType);
			}
		});
	</script>
}